package com.cheng.cms.service.impl;

import com.cheng.cms.domain.Residents;
import com.cheng.cms.mapper.ResidentDao;
import com.cheng.cms.service.ResidentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ResidentServiceImpl implements ResidentService {

    @Autowired
    private ResidentDao residentDao;

    @Override
    public List<Residents> selectAllResidents() {
        return residentDao.selectAllResidents();
    }

    @Override
    public List<Residents> selectResidentsByCondition(Map<String, String> mapCondition) {
        return residentDao.selectResidentsByCondition(mapCondition);
    }

    @Override
    public List<String> selectAllBuildingNo() {
        return residentDao.selectAllBuildingNo();
    }

    @Override
    public List<String> selectAllRoomNo() {
        return residentDao.selectAllRoomNo();
    }

    @Override
    public int addUser(Residents residents) {
        return residentDao.addUser(residents);
    }

    @Override
    public int deleteUserById(int id) {
        return residentDao.deleteUserById(id);
    }

    @Override
    public int updateUser(Residents residents) {
        return residentDao.updateUser(residents);
    }
}
